﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BookStore.Bussiness;
using BookStore.Data;
using BookStore.Common;

namespace BookStore
{
    public partial class Register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           
        }
        bool flag = true;
        private void insertcus() {
            customerInfo cus = new customerInfo();
            cus.customerName = txtfullname.Text;
            cus.email = txtemail.Text;
            cus.phone = txtxphone.Text;
            cus.address = txtadd.Text;
            cus.password = encryption.toMD5(txtpass.Text);
            encryption.toMD5(txtconfirmpass.Text);
            customerService.insertCustomer(cus);
            if (flag == true)
            {
                Response.Write("<script>window.alert('Register member success.')</script>");
                Response.Redirect("Login.aspx");
            }
            else {
                Response.Write("<script>window.alert('Not register member success.')</script>");
            }
            
        }
        protected void imbregister_Click(object sender, ImageClickEventArgs e)
        {
            insertcus();
        }
    }
}
